<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>

    <form action="#">
        <input type="text" value="hah">
        <input id="checkMale" type="checkbox" name="gender" value="male">
        <input id="checkFemale" type="checkbox" name="gender" value="female">
    </form>

<script>
    let uname = document.querySelector("input")
    console.log(uname.value)

    let male = document.querySelector("#checkMale")
    let female = document.querySelector("#checkFemale")

    male.checked = true

    female.disabled = true
</script>
</body>
</html>